﻿#include <iostream>
#include<functional>
using namespace std;

class myclass
{
public:
    int operator()(int x,int y)const
    {
        return x+y;
    }
    double operator()(double x,double y) const
    {
        return x+y;
    }
    int add(int x,int y)
    {
        cout<<"add"<<endl;
        return x+y;
    }
};

int main()
{
//    function<int(int,int)> func1=[](int x,int y)->int{return x+y;};
//    cout<<func1(10,20)<<endl;
    myclass obj;
    function<double(double,double)> func2=obj;
    cout<<func2(10.1,90.99)<<endl;
    return 0;
}
